<!--
 * @Description: 
 * @Autor: Zhongyu
 * @Date: 2021-03-17 09:42:39
 * @LastEditors: Zhongyu
 * @LastEditTime: 2021-03-17 10:00:15
-->
<template>
	<el-form :inline="true" :model="formData" id="z-search" class="z-search">
		<el-form-item v-for="(item, i) in formItems" :key="i" :label="`${item.label}：`">
			<el-input v-model="formData[item.key]" :placeholder="item.placeholder"></el-input>
		</el-form-item>
		<el-form-item>
			<el-button type="primary" @click="onSubmit">查 询</el-button>
		</el-form-item>
	</el-form>
</template>

<script>
export default {
	name: 'z-search',
	props: {
		formData: {
			type: Object,
			default: () => {
				return {};
			},
		},
		formItems: {
			type: Array,
			default: () => {
				return [];
			},
		},
	},
	methods: {
		onSubmit() {
			this.$emit('submit', this.formData);
		},
	},

	// [
	//         {
	//             label: "用户昵称",
	//             placeholder: "请输入用户昵称",
	//             type: "input"
	//         }
	//     ]
};
</script>
<style lang="less" src="./index.less"></style>
